<?php

/**
 * Platformgroup form base class.
 *
 * @method Platformgroup getObject() Returns the current form's model object
 *
 * @package    explications_informatiques
 * @subpackage form
 * @author     Guimezanes Cyrille
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePlatformgroupForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idtable2'            => new sfWidgetFormInputHidden(),
      'genre'               => new sfWidgetFormInputText(),
      'title_profil_membre' => new sfWidgetFormInputText(),
      'nom_champ'           => new sfWidgetFormInputText(),
      'nom_groupe'          => new sfWidgetFormInputText(),
      'online'              => new sfWidgetFormInputText(),
      'ordre'               => new sfWidgetFormInputText(),
      'can_be_excluded'     => new sfWidgetFormInputText(),
      'type'                => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idtable2'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idtable2')), 'empty_value' => $this->getObject()->get('idtable2'), 'required' => false)),
      'genre'               => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'title_profil_membre' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nom_champ'           => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'nom_groupe'          => new sfValidatorString(array('max_length' => 70, 'required' => false)),
      'online'              => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'ordre'               => new sfValidatorInteger(array('required' => false)),
      'can_be_excluded'     => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'type'                => new sfValidatorString(array('max_length' => 5, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('platformgroup[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Platformgroup';
  }

}
